import { fetch, query } from './api'
// 登录
let _login = code => {
  return fetch(
    'Login',
    {
      Code: code
    }
  )
}
// 授权
let _auth = (session_key, iv, encryptedData) => {
  return fetch(
    'GetUserInfo',
    {
      session_key,
      iv,
      encryptedData
    }
  )
}
// 获取验证码
let _code = tel => {
  return fetch(
    'SendPhoneCode',
    {
      Phone: tel
    }
  )
}
// 注册
let _signin = (UnionID, Name, Phone, Type) => {
  return fetch(
    'AgentRegist',
    {
      UnionID,
      Type,
      Name,
      Phone
    }
  )
}
// 通过id获取会员信息
let _getUserInfo = id => {
  return fetch(
    'GetAgentInfo',
    {
      UnionID: id
    }
  )
}
export {
  _login,
  _auth,
  _code,
  _signin,
  _getUserInfo
}